# -*-coding:utf-8-*-
from enum import Enum, unique


@unique
class Color(Enum):
    red = 1
    blue = 2
    yellow = 4
    white = 3
    green = 5


print(Color(1))
print(Color['red'])
c = Color.red
print(c.name, c.value)

# 可以作为迭代器使用
for color in Color:
    print(color)
print("*" * 50)
print(Color.__members__)
for color in Color.__members__.items():
    print(color)
